{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE CPP #-}
module Mainf where
import Text.Lucius(CssUrl,luciusFile,luciusFileDebug,renderCss)
import Data.Text(Text)
import qualified Data.Text.Lazy.IO as TLIO

data MyRoute = Home | Time | Stylesheet

render :: MyRoute -> [(Text,Text)]->Text
render Home _ = "/home"
render Time _ = "/time"
render Stylesheet _ = "/style.css"

template :: CssUrl MyRoute
#if PRODUCTION
template = $(luciusFile "C:\\workspace\\HaskellWeb\\template.lucius")
#else
template = $(luciusFileDebug "C:\\workspace\\HaskellWeb\\template.lucius")
#endif


main :: IO()
main = TLIO.putStrLn $ renderCss $ template render
